from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_apscheduler import APScheduler
from flask_cli import cli
import os

app = Flask(__name__)

app.config.from_pyfile("config/base_setting.py")
# ops_config=local|production
# liunx export ops_config=local|production
# windows set ops_config=local|production
# app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://root:123456@localhost/movie_cat"
# app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True
# if "ops_config" in os.environ:
#     app.config.from_pyfile("config/{}_setting.py".format(os.environ['ops_config']))
app.config.from_pyfile("config/local_setting.py")

db = SQLAlchemy(app)
scheduler = APScheduler()
scheduler.init_app(app)
